﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bingosoft.Data;

namespace MobileServer.Bll.Bis
{
    public class ActivityService
    {
        private Dao dao = Dao.Get();

        public ActivityInfo GetActivityInfo(string id)
        {
            return dao.QueryEntity<ActivityInfo>("Activity.GetActivity", new { Id = id });
        }

        /// <summary>
        /// 得到未结束的活动
        /// </summary>
        /// <returns></returns>
        public List<ActivityInfo> GetActivitysWithoutEnd()
        {
            return dao.QueryEntities<ActivityInfo>("Activity.GetActivityList").ToList();
        }

        /// <summary>
        /// 获取特定活动的报名人员清单
        /// </summary>
        /// <param name="activityId"></param>
        /// <returns></returns>
        public List<ActivityUserInfo> GetActivityUsers(string activityId)
        {
            return dao.QueryEntities<ActivityUserInfo>("Activity.ActivityUsers", new { ActivityId = activityId }).ToList();
        }
    }
}
